package com.nuanshui.heatedloan.credit.utils;

import com.nuanshui.framework.lang.SysStringUtils;
import com.nuanshui.heatedloan.credit.constant.BorrowType;
import com.nuanshui.heatedloan.credit.pay.PayRequest;

/**
 * Created by wangxw on 2017/8/2.
 */
public class PayBizTypeUtil {

    public static void setPayBizType(PayRequest payRequest,String orderId){
        if(SysStringUtils.isEmpty(orderId)){
            return;
        }
        String type=orderId.substring(14,15);
        if((BorrowType.SINGLELOAN+"").equals(type)){
            payRequest.setBizType(BorrowType.SINGLELOAN+"");
        }
        //闪电贷(BorrowType.LIGHTLOAN+"")
        else if((BorrowType.LIGHTLOAN+"").equals(type)){
            payRequest.setBizType(BorrowType.LIGHTLOAN+"");
        }
        //分期贷INSTALLMENT
        else if((BorrowType.INSTALLMENT+"").equals(type)){
            payRequest.setBizType(BorrowType.INSTALLMENT+"");
        }
    }

    public static void main(String[] args) {
        String orderId="201708012247569258461";
        String type=orderId.substring(14,15);
        System.out.println(type);
    }
}
